using Newtonsoft.Json;

namespace Framework
{
    public static partial class Utils
    {
        public static class Json
        {
            /// <summary>
            /// 反序列化
            /// </summary>
            public static T ToObject<T>(string jsonStr)
            {
                return JsonConvert.DeserializeObject<T>(jsonStr);
            }

            /// <summary>
            /// 序列化
            /// </summary>
            public static string ToJson(object jsonObject)
            {
                return JsonConvert.SerializeObject(jsonObject);
            }

        }

    }
}